package com.ruoyi.web.controller.hh;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.HhUserAccount;
import com.ruoyi.service.IHhUserAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 用户余额变动Controller
 * @author chongjin
 * @date 2020-12-23
 */
@Controller
public class HhUserAccountController extends BaseController {
    private String prefix = "hh/saleManage";

    @Autowired
    private IHhUserAccountService hhUserAccountService;

    @GetMapping("/user/account")
    public String account() {
        return prefix + "/account_view";
    }

    /**
     * 查询用户余额变动列表
     */
    @PostMapping("/user/account/list")
    @ResponseBody
    public TableDataInfo list(HhUserAccount hhUserAccount) {
        startPage();
        List<HhUserAccount> list = hhUserAccountService.selectHhUserAccountList(hhUserAccount);
        return getDataTable(list);
    }

}
